<?php echo js('admin/settings.js');?>
<?php echo js('jquery/popupWindow/jquery.popupWindow.js');?>
<script type="text/javascript">
	function delte_pickup_image(){
		$('#pickup_image_holder').html("");
		$('#pickup_image').val("");
	}
	jQuery(function($){
		$('#a_pickup').popupWindow({height:500, width:800, centerBrowser:1}); 
	});
</script>  
<div id="page-heading"><h1><?php echo sprintf(lang('attractions.edit_title'), def_lang($attraction, 'name', CURRENT_LANGUAGE))?></h1></div>
<?php $this->load->view('partials/notices'); ?>
<form method="post" action="<?php echo site_url('admin/catalog/edit_attraction/'. $attraction->id);?>" >
<table border="0" cellpadding="0" cellspacing="0"  id="id-form">
		<tr>
			<th valign="top"><?php echo lang('attractions.city_id'); ?><span class="require">*</span>:</th>
			<?php 
			$cities_option = array();
			foreach($cities as $city){
				$cities_option[$city->id] = empty($city->name)? lang('global:empty'): $city->name;
			}
			?>
			<td><?php echo form_dropdown('city_id', $cities_option, $attraction->city_id, 'id="city_id" class="select_box"'); ?></td>
		</tr>
		<tr>
			<th valign="top"><?php echo lang('attractions.latitude'); ?>:</th>
			<td><?php echo form_input('latitude', $attraction->latitude, 'class="inp-form"'); ?></td>
		</tr>
		<tr>
			<th valign="top"><?php echo lang('attractions.longitude'); ?>:</th>
			<td><?php echo form_input('longitude', $attraction->longitude, 'class="inp-form"'); ?></td>
		</tr>
		<tr>
			<th valign="top"><?php echo lang('attractions.image'); ?>:</th>
			<td>
			<input type="hidden" value="<?php echo $attraction->image?>" name="image" id="pickup_image"/>
			<a href="<?php echo site_url('admin/folders/pickup_image')?>" id="a_pickup"><img src="<?php echo image_url('admin/shared/icon.png')?>"/></a>
			<div id="pickup_image_holder">
			<?php if(!empty($attraction->image)):?>
				<a href="javascript:void(0);" onclick="delte_pickup_image()"><img src="<?php echo site_url('files/thumb/' . $attraction->image . '/64/64?'. rand(0, 99)); ?>" title="click to delete"/></a>
			<?php endif;?>
			</div>
			</td>
		</tr>
		<tr>
			<th valign="top"><?php echo lang('attractions.address'); ?>:</th>
			<td><?php echo form_textarea('address', $attraction->address, 'class="form-textarea"'); ?></td>
		</tr>
</table>	
<table border="0" cellpadding="0" cellspacing="0"  id="id-form" style="width:100%;">
		<tr>
			<th colspan="3">
			<div id="usual-tab" class="usual-tab">
				<ul class="idTabs"> 
					<?php foreach($supported_languages as $lang => $content): ?>
						<li><a href="#<?php echo $lang;?>"><span style="font-weight: bold; font-size:12px;"><?php echo $content['name'];?></span></a></li>
					<?php endforeach; ?>
				</ul>
				<?php foreach($supported_languages as $lang => $content): ?>
					<div id="<?php echo $lang;?>" class="lang_content">
						<fieldset>
							<table border="0" cellpadding="0" cellspacing="0"  id="id-form" style="width:100%;">
							<tr>
								<th valign="top"><?php echo lang('attractions.name_label'); ?><span class="require">*</span>:</th>
								<td><?php echo form_input('name_'. $lang, def_lang($attraction, 'name', $lang), 'class="inp-form"'); ?></td>
							</tr>
							<tr>
								<th valign="top"><?php echo lang('attractions.introduction_label'); ?><span class="require">*</span>:</th>
								<td><?php echo form_textarea('introduction_'. $lang, def_lang($attraction, 'introduction', $lang), 'class="form-textarea"'); ?>
								<?php echo display_ckeditor(ck_config_simple('introduction_'. $lang)); ?>
								</td>
							</tr>
							<tr>
								<th valign="top"><?php echo lang('attractions.description_label'); ?><span class="require">*</span>:</th>
								<td><?php echo form_textarea('description_'. $lang, def_lang($attraction, 'description', $lang), 'class="form-textarea"'); ?>
								<?php echo display_ckeditor(ck_config_simple('description_'. $lang)); ?>
								</td>
							</tr>
							</table>
						</fieldset>	
					</div> 
				<?php endforeach; ?> 
			</div> 
			</th>
		</tr>
	<tr>
		<th>&nbsp;</th>
		<td valign="top">
			<input type="submit" value="" class="form-submit" />
			<input type="reset" value="" class="form-reset"  />
		</td>
		<td></td>
	</tr>
	</table>
<input type="hidden" name="id" value="<?php echo $attraction->id?>"/>	
</form>	
